using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;

using FreeFlow.Administration;

namespace FreeFlowAdministrator
{
	/// <summary>
	/// Summary description for FolderForm.
	/// </summary>
	public class FolderForm : System.Windows.Forms.Form
	{
    private FreeFlowAdministrator.FolderControl folderControl;
    private FreeFlow.WinFormsControls.HelperClasses.RealPosition realPosition;
    private System.ComponentModel.IContainer components;

		public FolderForm()
		{
			//
			// Required for Windows Form Designer support
			//
			InitializeComponent();
		}

		/// <summary>
		/// Clean up any resources being used.
		/// </summary>
		protected override void Dispose( bool disposing )
		{
			if( disposing )
			{
				if(components != null)
				{
					components.Dispose();
				}
			}
			base.Dispose( disposing );
		}

		#region Windows Form Designer generated code
		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{
      this.components = new System.ComponentModel.Container();
      System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(FolderForm));
      this.folderControl = new FreeFlowAdministrator.FolderControl();
      this.realPosition = new FreeFlow.WinFormsControls.HelperClasses.RealPosition(this.components);
      this.SuspendLayout();
      // 
      // folderControl
      // 
      this.folderControl.ActionsVisible = true;
      this.folderControl.Dock = System.Windows.Forms.DockStyle.Fill;
      this.folderControl.Location = new System.Drawing.Point(0, 0);
      this.folderControl.Name = "folderControl";
      this.folderControl.Size = new System.Drawing.Size(584, 491);
      this.folderControl.TabIndex = 0;
      this.folderControl.ItemDeleted += new System.EventHandler(this.folderControl_FolderDeleted);
      // 
      // realPosition
      // 
      this.realPosition.Parent = this;
      this.realPosition.RegistryPath = "Software\\FreeFlow\\Administrator\\FolderForm";
      // 
      // FolderForm
      // 
      this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
      this.ClientSize = new System.Drawing.Size(584, 491);
      this.Controls.Add(this.folderControl);
      this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
      this.Name = "FolderForm";
      this.realPosition.SetRestoreLocation(this, true);
      this.Text = "Folder";
      this.ResumeLayout(false);

    }
		#endregion

    public void LoadFolder(Folder folder)
    {
      folderControl.LoadFolder(folder);
      Text = folder.Name + " - Folder";
    }

    private void folderControl_FolderDeleted(object sender, System.EventArgs e)
    {
      Close();
    }
	}
}
